{"version":3,"file":"range.min.js","sources":["range.js"],"names":["global","window","rangy","amdSupported","define","amd","OBJECT","FUNCTION","UNDEFINED","domRangeProperties","domRangeMethods","textRangeProperties","textRangeMethods","isHostMethod","o","p","t","isHostObject","isHostProperty","createMultiplePropertyTest","testFunc","props","i","length","areHostMethods","areHostObjects","areHostProperties","isTextRange","range","getBody","doc","body","getElementsByTagName","modules","api","version","initialized","supported","util","features","config","alertOnFail","alertOnWarn","preferTextRange","consoleLog","msg","console","log","alertOrLog","shouldAlert","alert","fail","reason","warn","hasOwnProperty","extend","obj","deep","el","document","createElement","appendChild","slice","toArray","call","childNodes","nodeType","arrayLike","e","arr","len","addListener","eventType","listener","addEventListener","attachEvent","initListeners","getErrorDesc","ex","message","description","String","init","testRange","implementsDomRange","implementsTextRange","createRange","detach","nodeName","toLowerCase","createTextRange","module","errorMessage","moduleName","Module","addInitListener","push","createMissingNativeApiListeners","addCreateMissingNativeApiListener","createMissingNativeApi","win","name","dependencies","initializer","this","prototype","requiredModuleNames","requiredModule","Error","deprecationNotice","deprecated","replacement","createError","createModule","isCore","initFunc","newModule","arguments","createCoreModule","RangePrototype","rangePrototype","SelectionPrototype","selectionPrototype","docReady","loadHandler","UNDEF","textNode","createTextNode","arrayContains","val","isHtmlNamespace","node","ns","namespaceURI","parentElement","parent","parentNode","getNodeIndex","previousSibling","getNodeLength","getCommonAncestor","node1","node2","ancestors","n","isAncestorOf","ancestor","descendant","selfIsAncestor","isOrIsAncestorOf","getClosestAncestorIn","isCharacterDataNode","isTextOrCommentNode","insertAfter","precedingNode","nextNode","nextSibling","insertBefore","splitDataNode","index","positionsToPreserve","newNode","cloneNode","deleteData","position","offset","getDocument","ownerDocument","getWindow","defaultView","parentWindow","getIframeDocument","iframeEl","contentDocument","contentWindow","getIframeWindow","isWindow","getContentDocument","methodName","tagName","getRootContainer","comparePoints","nodeA","offsetA","nodeB","offsetB","nodeC","root","childA","childB","firstChild","crashyTextNodes","isBrokenNode","innerHTML","inspectNode","data","idAttr","id","fragmentFromNodeChildren","fragment","createDocumentFragment","child","getComputedStyleProperty","getComputedStyle","propName","documentElement","currentStyle","NodeIterator","_next","_current","hasNext","next","createIterator","DomPosition","equals","pos","inspect","toString","DOMException","codeName","code","INDEX_SIZE_ERR","HIERARCHY_REQUEST_ERR","WRONG_DOCUMENT_ERR","NO_MODIFICATION_ALLOWED_ERR","NOT_FOUND_ERR","NOT_SUPPORTED_ERR","INVALID_STATE_ERR","dom","isNonTextPartiallySelected","startContainer","endContainer","getRangeDocument","getBoundaryBeforeNode","getBoundaryAfterNode","insertNodeAtPosition","firstNodeInserted","rangesIntersect","rangeA","rangeB","touchingIsIntersecting","assertRangeValid","startComparison","startOffset","endOffset","endComparison","cloneSubtree","iterator","partiallySelected","frag","subIterator","isPartiallySelectedSubtree","getSubtreeIterator","iterateSubtree","rangeIterator","func","iteratorState","it","stop","subRangeIterator","deleteSubtree","remove","extractSubtree","getNodesInRange","nodeTypes","filter","filterNodeTypes","regex","filterExists","RegExp","join","nodes","RangeIterator","test","sc","ec","getName","clonePartiallySelectedTextNodes","collapsed","so","eo","commonAncestorContainer","isSingleCharacterDataNode","_first","_last","reset","current","start","end","removeChild","subRange","cloneRange","collapse","Range","updateBoundaries","detachRange","RangeException","BAD_BOUNDARYPOINTS_ERR","INVALID_NODE_TYPE_ERR","beforeAfterNodeTypes","rootContainerNodeTypes","readonlyNodeTypes","insertableNodeTypes","surroundNodeTypes","createAncestorFinder","getDocumentOrFragmentContainer","getReadonlyAncestor","getDocTypeNotationEntityAncestor","assertNoDocTypeNotationEntityAncestor","allowSelf","assertNotDetached","assertValidNodeType","invalidTypes","assertValidOffset","assertSameDocumentOrFragment","assertNodeNotReadOnly","assertNode","isOrphan","isValidOffset","isRangeValid","styleEl","htmlParsingConforms","createContextualFragment","fragmentStr","splitRangeBoundaries","startEndSame","setStartAndEnd","rangeProperties","s2s","s2e","e2e","e2s","n_b","n_a","n_b_a","n_i","compareBoundaryPoints","how","prefixA","prefixB","insertNode","setStartBefore","cloneContents","clone","canSurroundContents","boundariesInvalid","surroundContents","content","extractContents","hasChildNodes","lastChild","selectNode","prop","textParts","compareNode","nodeIndex","comparePoint","toHtml","container","intersectsNode","isPointInRange","intersectsRange","intersectsOrTouchesRange","intersection","intersectionRange","setStart","setEnd","union","unionRange","containsNode","allowPartial","containsNodeContents","containsRange","containsNodeText","nodeRange","textNodes","getNodes","lastTextNode","pop","contains","collapseBefore","setEndBefore","collapseAfter","setStartAfter","getBookmark","containerNode","preSelectionRange","selectNodeContents","moveToBookmark","bookmark","charIndex","nodeStack","foundStart","nextCharIndex","rangesEqual","isValid","copyComparisonConstantsToObject","START_TO_START","START_TO_END","END_TO_END","END_TO_START","NODE_BEFORE","NODE_AFTER","NODE_BEFORE_AND_AFTER","NODE_INSIDE","copyComparisonConstants","constructor","createRangeContentRemover","remover","boundaryUpdater","boundary","returnValue","createPrototypeRange","detacher","createBeforeAfterNodeSetter","isBefore","isStart","setRangeStart","setRangeEnd","F","args","setBoundary","setEndAfter","deleteContents","splitBoundaries","splitBoundariesPreservingPositions","normalizeBoundaries","mergeForward","sibling","appendData","mergeBackward","nodeLength","insertData","normalizeStart","endNode","startNode","collapseToPoint","updateCollapsedAndCommonAncestor","r1","r2","DomRange","WrappedRange","WrappedTextRange","rangeProto","updateRangeProperties","nativeRange","updateNativeRange","startMoved","endMoved","nativeRangeDifferent","detached","refresh","testTextNode","oppositeName","range2","type","createNativeRange","getTextRangeContainerElement","textRange","parentEl","duplicate","startEl","endEl","startEndContainer","textRangeIsCollapsed","compareEndPoints","getTextRangeBoundaryPosition","wholeRangeContainerElement","isCollapsed","startInfo","workingRange","containerElement","canHaveHTML","boundaryPosition","nodeInfo","workingNode","comparison","workingComparisonType","previousNode","boundaryNode","childNodeCount","moveToElementText","Math","floor","setEndPoint","tempRange","rangeLength","text","replace","moveStart","createBoundaryTextRange","boundaryParent","boundaryOffset","nodeIsDataNode","startBoundary","rangeContainerElement","rangeToTextRange","startRange","endRange","globalObj","createRangyRange","createIframeRange","createIframeRangyRange","checkSelectionRanges","BOOLEAN","NUMBER","getNativeSelection","selectionIsCollapsed","CONTROL","isDirectionBackward","dir","WrappedSelection","getWinSelection","winParam","getSelection","getDocSelection","selection","winSelectionIsBackward","sel","backward","anchorNode","anchorOffset","focusNode","focusOffset","implementsWinGetSelection","implementsDocSelection","useDocumentSelection","isSelectionValid","nativeSel","testSelection","selectionHasAnchorAndFocus","selectionHasExtend","selectionHasRangeCount","rangeCount","selectionSupportsMultipleRanges","collapsedNonEditableSelectionsSupported","addRangeBackwardToNative","nativeSelection","addRange","getNativeRange","originalSelectionRangeCount","selectionHasMultipleRanges","originalSelectionRanges","originalSelectionBackward","getRangeAt","testEl","contentEditable","navigator","userAgent","indexOf","removeAllRanges","implementsControlRange","testControlRange","createControlRange","updateAnchorAndFocusFromRange","anchorPrefix","focusPrefix","updateAnchorAndFocusFromNativeSelection","updateEmptySelection","_ranges","rangeContainsSingleElement","rangeNodes","getSingleElementFromRange","updateFromTextRange","wrappedRange","updateControlSelection","docSelection","controlRange","item","addRangeToControlSelection","rangeElement","newControlRange","add","select","getSelectionRangeAt","deleteProperties","cachedRangySelections","actOnCachedSelection","action","cached","splice","docSel","getIframeSelection","selProto","createControlSelection","ranges","addRangeBackward","direction","previousRangeCount","selectionIsBackward","setRanges","empty","refreshSelection","checkForChanges","oldRanges","oldAnchorNode","oldAnchorOffset","removeRangeManually","getAllRanges","removeRange","removed","isBackward","isBackwards","rangeTexts","assertNodeInSameDocument","setSingleRange","collapseToStart","collapseToEnd","selectAllChildren","deleteFromDocument","element","eachRange","callMethodOnEachRange","params","results","apply","createStartOrEndSetter","changeEachRange","rangeBookmarks","selRanges","rangeBookmark","rangeInspects","anchor","focus","detachAll","Selection"],"mappings":"CAUA,SAAUA,GAET,GAAGC,OAAOC,MACV,CACC,OAGE,GAAIC,SAAuBH,GAAOI,QAAU,YAAcJ,EAAOI,OAAOC,GAExE,IAAIC,GAAS,SAAUC,EAAW,WAA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